{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 机器学习100天——第二天：简单线性回归\n",
    "## 第一步：数据预处理"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里导入我们需要的库，值得注意的是，这里比第一天多了一个matplotlib.pyploy:matplotlib是python上的一个2D绘图库,\n",
    "matplotlib下的模块pyplott是一个有命令样式的函数集合，\n",
    "matplotlib.pyploy是为我们对结果进行图像化作准备的。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入相关数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    Hours  Scores\n",
      "0     2.5      21\n",
      "1     5.1      47\n",
      "2     3.2      27\n",
      "3     8.5      75\n",
      "4     3.5      30\n",
      "5     1.5      20\n",
      "6     9.2      88\n",
      "7     5.5      60\n",
      "8     8.3      81\n",
      "9     2.7      25\n",
      "10    7.7      85\n",
      "11    5.9      62\n",
      "12    4.5      41\n",
      "13    3.3      42\n",
      "14    1.1      17\n",
      "15    8.9      95\n",
      "16    2.5      30\n",
      "17    1.9      24\n",
      "18    6.1      67\n",
      "19    7.4      69\n",
      "20    2.7      30\n",
      "21    4.8      54\n",
      "22    3.8      35\n",
      "23    6.9      76\n",
      "24    7.8      86\n"
     ]
    }
   ],
   "source": [
    "dataset = pd.read_csv('../datasets/studentscores.csv')\n",
    "print(dataset)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这里我们需要使用pandas的iloc(区分于loc根据index来索引，iloc利用行号来索引)方法来对数据进行处理，第一个参数为行号，:表示全部行，第二个参数 ：1表示截到第1列(也就是取第0列)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X = dataset.iloc[ : ,   : 1 ].values\n",
    "Y = dataset.iloc[ : , 1 ].values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "导入sklearn库的cross_validation类来对数据进行训练集、测试集划分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/ymao/usr/miniconda/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.\n",
      "  \"This module will be removed in 0.20.\", DeprecationWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.cross_validation import train_test_split\n",
    "X_train, X_test, Y_train, Y_test = train_test_split( X, Y, test_size = 1/4, random_state = 0) "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第二步：训练集使用简单线性回归模型来训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从sklearn的线性模型类中调用线性回归模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.linear_model import LinearRegression"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "创建一个线性回归对象regressor,并对训练集利用fit()方法进行训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "regressor = LinearRegression()\n",
    "regressor = regressor.fit(X_train, Y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 第三步：预测结果"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "利用predict()方法对测试集进行预测"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Y_pred = regressor.predict(X_test)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 训练集结果可视化"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "首先调用scatter方法，对训练集作散点图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7fe708af19b0>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.scatter(X_train , Y_train, color = 'red')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "调用plot方法对训练集的预测作曲线图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fe708b04550>]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.plot(X_train , regressor.predict(X_train), color ='blue')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将结果可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGg5JREFUeJzt3X+wlGXdx/H3lx+mYCIID6IIx8rRpyFDPVqZmYo6/si0\ndCw9Now2Umn+yGfG0UidVMpnMM2xSTuBSnrSUbA0Iw0ttGyEDqAhIo+/QNGDHhRUOIrA+T5/XLvu\n2bMLZ/fsvXvfe+/nNcPsuW727H6j4+d897q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vmhmQzL/\nPU4inMuKlZn9V+ZxHGH+/Pdx1TIorjfeHjO7GzgCGGlmq4Gr3H1mvFXxZeA7wNLMnDXAj919bow1\njQFmZVYiDADudffELBNMmNHAH0IOMAj4vbs/HG9JH7sAaMtMcbwMnB1zPdlfescA34u7lix3X2Bm\ns4HFwBZgCQm4OhOYY2a7AZuB8+M8qZ3IZYsiIlI+TbmIiKSEAl1EJCUU6CIiKaFAFxFJCQW6iEhK\nKNBFRFJCgS4ikhIKdBGRlPh/Rc+jTuQbrmQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fe70c5abac8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 测试集结果可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD8CAYAAABn919SAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGwFJREFUeJzt3XtwXOV9//H3F9nGNy42GCEwttJgIMQtJigQCklJgIZL\nAp50QpOY1E1pDE3SEGBKTTyl4VcgJJ0AYRpoVeJWCSLEgTA2hjE15p7UdmQwJr4QYYKMXdkSGBBG\nwTd9f388R0hHkq2V9nL2nP28Zjy7z6Nd7Xex+eirZ895jrk7IiKSfgckXYCIiBSGAl1EJCMU6CIi\nGaFAFxHJCAW6iEhGKNBFRDJCgS4ikhEKdBGRjFCgi4hkxIhSvtjhhx/utbW1pXxJEZHUW7Vq1evu\nPmmwx5U00Gtra2lqairlS4qIpJ6ZteTyOC25iIhkhAJdRCQjFOgiIhmhQBcRyQgFuohIRijQRUQy\nQoEuIpIRCnQRkSL6znfg+98vzWuV9MQiEZFK8bvfwfHH94yvvbb4r6kOXUSkgNzhL/8yHuYdHaV5\nbQW6iEiBPP88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k2xJ+XH3LdFtG/AgcGqyFeVlM7C512+A9xMCPs3OB55z921JFzJUCvRI9EHij4H17n5r\n0vXkw8wmmdmh0f0xwLnAhmSrGh53v87dJ7t7LeHX4Mfd/dKEyxo2MxsXfehOtDTx58Bvk61q+Nx9\nK/CamR0fTZ0NpO5Agj6+SAqXWyD8uiTBGcCXgRejtWeAb7v7IwnWNFw1QEP0Sf0BwAJ3T/3hfhlR\nDTwY+gdGAPe6+5JkS8rb3wON0VLFK8BXEq5n2KIfsucClyddy3DosEURkYzQkouISEYo0EVEMkKB\nLiKSEQp0EZGMUKCLiGSEAl1EJCMU6CIiGaFAFxHJiP8PldXB71FyIikAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7fe708b04dd8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X_test , Y_test, color = 'red')\n",
    "plt.plot(X_test , regressor.predict(X_test), color ='blue')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "<b>完整的项目请前往Github项目<a href=\"https://github.com/MachineLearning100/100-Days-Of-ML-Code\">100-Days-Of-ML-Code</a>查看。有任何的建议或者意见欢迎在issue中提出~</b>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
